;-----------------------------------------------------------------;
;  Copyright (C) 2011, Ryabov Alex. All rights reserved.          ;
;  Distributed under terms of the GNU General Public License.     ;
;  See file COPYING for details.                                  ;
;-----------------------------------------------------------------;
;  Omaha32                                                        ;
;  /export.inc                                                    ;
;-----------------------------------------------------------------;


kernel_names:
  dd szGetProcAddress - (os_base + 0x100000)
  dd szLoadLibrary - (os_base + 0x100000)
  dd szVirtualAllocK - (os_base + 0x100000)
  dd szVirtualFreeK - (os_base + 0x100000)
  dd 0

export_names:
  szGetProcAddress db  'GetProcAddress',0
  szLoadLibrary    db  'LoadLibrary',0
  szVirtualAllocK  db  'VirtualAllocK',0
  szVirtualFreeK   db  'VirtualFreeK',0

kernel_export:
  dd GetProcAddress - (os_base + 0x100000)
  dd LoadLibrary - (os_base + 0x100000)
  dd kernel_valloc - (os_base + 0x100000)
  dd kernel_vfree - (os_base + 0x100000)

proc kernel_valloc stdcall, count:dword
  pushfd
  push ecx
  mov  ecx,[count]
  call kalloc_mem
  pop  ecx
  popfd
  ret
endp

proc kernel_vfree stdcall, ptr:dword
  pushfd
  push eax
  mov  eax,[ptr]
  call kfree_mem
  pop  eax
  popfd
  ret
endp